package com.yikome.product.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Index;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.data.annotation.CreatedBy;

import com.yikome.common.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor
@Entity
@Table(name = "p_product_ext" , indexes = {@Index(columnList = "productId") , @Index(columnList = "sourceType")})
public class ProductExt extends BaseEntity {

	private static final long serialVersionUID = -1961247003387576511L;

	private Long productId;

    private String comments ;

    //来源分类
    private String sourceType ;
    
	private Long supplierId ; 
	
	private String sourceId ; 
	
	private String sourceTitle ;
	
	private String sourceUrl ; 
	
	private String sourceNumber ; //货号
    
    // 产品详情字符串
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String productDetails;

    // 轮播图
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String carouselImages;

    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss z", locale = "zh", timezone = "GMT+8")
    private Date upAt;
    
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss z", locale = "zh", timezone = "GMT+8")
    private Date downAt;
    
    private Long categoryId ; //产品分类ID
    
    @CreatedBy
    private String createdBy;
    
    
    //20200715
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String productProps;
}
